<header class="navbar navbar-gitlab with-horizontal-nav">
    <a class="sr-only gl-accessibility" href="#content-body" tabindex="1">Skip to content</a>
    <div class="container-fluid">


        <div class="header-content">
<!--            <div id="sidebar-control" class="sidebar-control">-->
<!--                <i class="fa fa-indent"></i>-->
<!--            </div>-->

            {% include 'twig/common/body/header-logo.twig' %}
            {% include 'twig/common/body/header-title-container.twig' %}
            {% include 'twig/common/body/header-dropdown.twig' %}


            <div class="navbar-collapse collapse">
                <ul class="nav navbar-nav">
                    <li class="hidden-sm hidden-xs">
                        <div class="has-location-badge search search-form">
                            <form class="navbar-form" action="/search" accept-charset="UTF-8" method="get">
                                <input name="utf8" type="hidden" value="✓">
                                <input name="scope" type="hidden" value="">
                                <div class="search-input-container">
                                        {% if project_id %}
                                        <div class="location-badge">
                                            当前项目
                                        </div>
                                        {% endif %}
                                    <div class="search-input-wrap">

                                            <div class="dropdown " data-url="/search/autocomplete">

                                                <input type="search" name="keyword" id="search" placeholder="Search"
                                                       class="search-input dropdown-menu-toggle no-outline js-search-dashboard-options disabled js-key-search "
                                                       spellcheck="false" tabindex="1" autocomplete="off"
                                                       data-toggle="dropdown"
                                                       data-issues-path=""

                                                >
                                                <div class="dropdown-menu dropdown-select">
                                                    <div class="dropdown-content">
                                                        <ul>
                                                            <li><a class="is-focused dropdown-menu-empty-link">
                                                                    Loading... </a></li>
                                                        </ul>
                                                    </div>
                                                    <div class="dropdown-loading">
                                                        <i class="fa fa-spinner fa-spin"></i>
                                                    </div>
                                                </div>
                                                <i class="search-icon"></i>
                                                <i class="clear-icon js-clear-input"></i>
                                            </div>
                                    </div>
                                </div>
                                <input type="hidden" name="group_id" id="group_id" class="js-search-group-options">
                                <input type="hidden" name="project_id" id="search_project_id" value="{{project_id}}"
                                       class="js-search-project-options" data-project-path="default" data-name="{{project.name}}"
                                       data-issues-path="{{project_root_url}}/issues">
                                <input type="hidden" name="repository_ref" id="repository_ref">
                                <div class="search-autocomplete-opts hide" data-autocomplete-path="/search/autocomplete"
                                     data-autocomplete-project-id="{{project_id}}">

                                </div>
                            </form>
                        </div>
                    </li>

                    <li class="visible-sm-inline-block visible-xs-inline-block">
                        <a title="Search" aria-label="Search" data-toggle="tooltip" data-placement="bottom"
                           data-container="body" href="/search">
                            <i class="fa fa-search"></i>
                        </a>
                    </li>

                    <li>
                        <a title="新增项目" aria-label="New project" data-toggle="tooltip" data-placement="bottom"
                           data-container="body" href="/project/main/_new" class="key-new-project">
                            <i class="fa fa-plus fa-fw"></i>
                        </a>
                    </li>

                    <li>
                        <a title="分配给我的问题" aria-label="分配给我的问题" data-toggle="tooltip" data-placement="bottom"
                           data-container="body" href="/issue/main?sys_filter=assignee_mine">
                            <i class="fa fa-hashtag fa-fw"></i><!--  <span class="badge issues-count"> {{assignee_count}}</span> -->
                        </a>
                    </li>

                    <li>
                        <a title="系统消息" aria-label="Open issue" class="shortcuts-todos" data-toggle="tooltip"
                           data-placement="bottom"
                           data-container="body" href="/user/msg_system">
                            <i class="fa fa-envelope-o fa-fw"></i> {% if ( _unread_count>0 ) %}<span class="badge merge-requests-count">{{_unread_count}}</span>{% endif %}
                        </a>
                    </li>

                    <li class="nav-item header-help dropdown">
                        <a class="header-help-dropdown-toggle" data-toggle="dropdown" href="#" aria-expanded="false">
                            <i class="fa fa-info-circle "></i>
                            <i class="fa fa-caret-down"></i>
                        </a>
                        <div class="dropdown-menu dropdown-menu-right">
                            <ul>
                                <li>
                                    <a  target="_blank" href="http://www.masterlab.vip/help.php">帮 助</a>
                                </li>
                                <li class="divider"></li>
                                <li>
                                    <a title="关于"
                                       aria-label="关于masterlab"
                                       data-target="#modal-about"
                                       data-toggle="modal"
                                       href="#modal-about">关 于
                                    </a>
                                </li>
                                {% if is_admin %}
                                    <li>
                                        <a title="升级"
                                           aria-label="在线升级Masterlab"
                                           data-target="#modal-upgrade"
                                           data-toggle="modal"
                                           id="menu-upgrade"
                                           href="#modal-upgrade">升 级</a>
                                    </li>
                                {% endif %}
                                <li>
                                    <a target="_blank" class="text-nowrap" href="https://github.com/gopeak/masterlab">点 赞
                                    </a>
                                </li>

                                <li class="js-canary-link">
                                    <a  target="_blank" href="http://www.masterlab.vip/donate.php" >捐 助</a>
                                </li>
                            </ul>
                        </div>
                    </li>
                    <li class="header-user dropdown">
                        <a class="header-user-dropdown-toggle" data-toggle="dropdown" href="/{{user.username}}">
                            <img width="26" height="26" class="header-user-avatar" src="{{user.avatar}}" alt="Avatar">
                            <i class="fa fa-caret-down"></i>
                        </a>
                        <div class="dropdown-menu-nav dropdown-menu-align-right">
                            <ul>
                                <li><a class="profile-link" aria-label="Profile" data-user="sven"  href="/user/profile">个人资料</a></li>
                                <li><a aria-label="Settings" href="/user/profile_edit">个人设置</a></li>
                                <li class="divider"></li>
                                <li><a class="sign-out-link" aria-label="Sign out" rel="nofollow"  href="/passport/logout">注  销</a></li>
                            </ul>
                        </div>
                    </li>

                </ul>
            </div>

            <button class="navbar-toggle" type="button"><span class="sr-only">Toggle navigation</span> <i
                        class="fa fa-ellipsis-v"></i></button>
            <div class="js-dropdown-menu-projects">
                <div class="dropdown-menu dropdown-select dropdown-menu-projects">
                    <div class="dropdown-title">
                        <span>切换项目</span>
                        <button class="dropdown-title-button dropdown-menu-close" aria-label="Close" type="button">
                            <i class="fa fa-times dropdown-menu-close-icon"></i>
                        </button>
                    </div>
                    <div class="dropdown-input">
                        <input type="search" id="project_search" class="dropdown-input-field" placeholder="搜索你的项目"
                               autocomplete="off"/>
                        <i class="fa fa-search dropdown-input-search"></i>
                        <i role="button" class="fa fa-times dropdown-input-clear js-dropdown-input-clear"></i>
                    </div>
                    <div class="dropdown-content"></div>
                    <div class="dropdown-loading">
                        <i class="fa fa-spinner fa-spin"></i>
                    </div>
                </div>
            </div>
        </div>


    </div>
</header>


<div class="modal" id="modal-about">

    <div class="modal-dialog">
        <div class="modal-content modal-middle">
            <div class="modal-header">
                <a class="close js-key-modal-close1" data-dismiss="modal" href="#">×</a>
                <h3 class="modal-header-title">关于</h3>
            </div>

            <div class="modal-body overflow-x-hidden">

                <table width="468" border="0">
                    <tr>
                        <th width="39" height="31" scope="col">&nbsp;</th>
                        <th width="419" align="left" scope="col"><h2>Masterlab社区版</h2></th>
                    </tr>
                    <tr>
                        <th height="25" scope="row">&nbsp;</th>
                        <td align="left">项目管理更简单，更轻松!</td>
                    </tr>
                    <tr>
                        <th scope="row">&nbsp;</th>
                        <td align="left">当前版本：{{ _version }} <a href="https://github.com/gopeak/masterlab/releases">版本说明</a></td>
                    </tr>
                    {% if is_admin %}
                        <tr>
                            <th scope="row">&nbsp;</th>
                            <td align="left">版本升级：<a href="javascript:;" id="btn-upgrade">立即升级</a></td>
                        </tr>
                    {% endif %}
                    <tr>
                        <th scope="row">&nbsp;</th>
                        <td align="left"><hr /></td>
                    </tr>
                    <tr>
                        <th scope="row">&nbsp;</th>
                        <td align="left">官方网站:<a href="http://www.masterlab.vip/">http://www.masterlab.vip/</a></td>
                    </tr>
                    <tr>
                        <th scope="row">&nbsp;</th>
                        <td align="left"><span>QQ群：314155057</span></td>
                    </tr>
                    <tr>
                        <th height="22" scope="row">&nbsp;</th>
                        <td align="left"><hr /></td>
                    </tr>
                    <tr>
                        <th scope="row">&nbsp;</th>
                        <td align="left"><span>感谢以下开发人员的贡献:</span></td>
                    </tr>
                    <tr>
                        <th scope="row">&nbsp;</th>
                        <td align="left">sven 晒不黑 mo jelly  </td>
                    </tr>
                    <tr>
                        <th scope="row">&nbsp;</th>
                        <td align="left">&nbsp;</td>
                    </tr>
                </table>
            </div>

            <div class="modal-footer form-actions">
                <a class="btn btn-cancel" data-dismiss="modal" href="#">关 闭</a>
            </div>
        </div>
    </div>
</div>

<div class="modal" id="modal-upgrade">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <a class="close js-key-modal-close1" href="#" id="btn-modal-close">×</a>
                <h3 class="modal-header-title">在线更新</h3>
            </div>

            <div class="modal-body overflow-x-hidden" id="modal-upgrade-body">
                <p>注意事项</p>
                <ol class="text-warning">
                    <li>在线更新方式不适合已经二次开发的masterlab。</li>
                    <li class="danger">执行更新前建议请先备份数据库和代码。</li>
                    <li>升级过程请勿对masterlab进行任何操作。</li>
                </ol>

                <p></p>
                <p>当前版本：<span>{{_version}}</span></p>
                <p>最新版本：<span id="new-version">正在检测...</span>&nbsp;&nbsp;<span id="check-message" ></span>&nbsp;&nbsp;<a href="" target="_blank" id="version-description" class="hidden">版本说明</a>&nbsp;&nbsp;<a href="javascript:;" id="btn-check-again" class="hidden">重新检测</a></p>

                <div class="row control-group form-inline" id="upgrade-source-wrap">
                    <div class="col-lg-12">更 新 源：<input type="text" name="upgrade_source" id="upgrade-source" value="http://www.masterlab.vip/" class="form-control form-control-inline" style="width: 200px;"><span style="margin-left: 10px;">若无特别说明，请勿修改此地址</span></div>
                </div>
                <div id="upgrade-message" style="height: 300px; max-height: 300px; overflow: auto; border: solid 1px #cccccc; margin-top: 10px;"></div>
            </div>

            <div class="modal-footer form-actions">
                <a class="btn btn-save disabled" href="#" id="btn-do-upgrade">立即升级</a>
                <a class="btn btn-cancel" data-dismiss="modal" href="#" id="btn-cancel-upgrade">关 闭</a>
            </div>
        </div>
    </div>
</div>

{% if is_admin %}
    <div class="alert alert-info alert-dismissible hidden" role="alert" id="upgrade-msg" style="background-color: #1f78d1; border-color: #1f78d1; color: #fff; margin-bottom: 0;">
        <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <div>Masterlab有更新，最新版本：<span id="update-new-version"></span>　<a href="" id="update-release_url" target="_blank">版本说明</a>　<a href="javascript:;" id="btn-do-daily-update" style="color: orange;">立即升级</a></div>
    </div>
{% endif %}

{% include 'twig/common/announcement.twig' %}
{% include 'twig/helper/helper.twig' %}

